var projectName=window.location.href.split('/')[3];
var bfsprojectName="bfs";
var gemsprojectName="gems";
var skin='default';
 
var modulelist=[];
var systemType=-1;
/***********动态根据日期插入js，css************/
function load(moduleliststr){
	var cookieskin=getCookie("cookieskin");
	if(cookieskin!==null){
		skin=cookieskin;
	}else{
		skin="default";
	}
	modulelist = moduleliststr;
	importScript("/bfs/common/scripts/base.js");	
}
//以yyyy-mm-dd为版本
function getVersion() {
    var d = currDate = new Date();
    return "" + d.getFullYear() + (d.getMonth() + 1) + d.getDate();
}
// 导入网页图标和收藏家图标
function importShortTitle() {
    // 地址栏和标签上显示图标
    document.write('<link rel="Shortcut Icon" href="common/images/favicon.ico"/>');
    // 收藏夹显示图标
    document.write('<link rel="Bookmark" href="common/images/favicon.ico"/>');
}

// 导入Js文件
function importScript(url) {
    document.write('<script type="text/javascript" src="' + url + '?' + getVersion() + '"></script>');
}

// 导入样式文件
function importStyle(url) {
	if(url.indexOf("skin") === -1){
		 document.write('<link rel="stylesheet" type="text/css" href="' + url +'?' + getVersion() + '"/>');
	}else{
		 document.write('<link rel="stylesheet" title="skin" type="text/css" href="' + url +'?' + getVersion() + '"/>');
	}
}

function getProjectUrl(url) {
    return "/"+projectName+url;
}

//读取cookies 
function getCookie(name) 
{ 
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
 
    if(arr=document.cookie.match(reg))
 
        return unescape(arr[2]); 
    else 
        return null; 
}

function setCookie(name,value) 
{ 
    var Days = 30; 
    var exp = new Date(); 
    exp.setTime(exp.getTime() + Days*24*60*60*1000); 
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString()+";path=/";  
}